package testUnit;

import static org.junit.Assert.*;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.PrintStream;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import FamilyTherapy.Player;
import FamilyTherapy.GCWindow;
import FamilyTherapy.Game;
import FamilyTherapy.SayActCard;
import FamilyTherapy.MagicToolCard;

public class testGCWindow {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testGCWindow() {

		boolean isNEW=false;
		GCWindow g = new GCWindow();
		
		if(g != null)
			isNEW=true;
		assertEquals(true,isNEW);
	}

	@Test
	public void testDisplayWelcome() {
		
		final ByteArrayOutputStream outContent = new ByteArrayOutputStream();
		System.setOut(new PrintStream(outContent));
		
		GCWindow g = new GCWindow();	
		g.displayWelcome();
		
		String expected = "Welcome to the game! Let's start it!\n";
			
		assertEquals(expected,outContent.toString());
	}
	@Test
	public void testOutputStr() {
		
		final ByteArrayOutputStream outContent = new ByteArrayOutputStream();
		System.setOut(new PrintStream(outContent));
		
		GCWindow g = new GCWindow();	
		g.outputStr("hi\n");
		
		String expected = "hi\n";
			
		assertEquals(expected,outContent.toString());
	}
}
